add_executable(tst_import3drender WIN32 MACOSX_BUNDLE
    ../../render/qmlscenereader/qmlscenereader.cpp ../../render/qmlscenereader/qmlscenereader.h
    tst_import3drender.cpp
)
qt_add_qml_module(tst_import3drender
    URI tst_import3drender
    VERSION ${PROJECT_VERSION}
    QML_FILES
        3drender.qml
    NO_RESOURCE_TARGET_PATH
)

# Avoid collision between executable name and QML module directory (QTBUG-98568).
if(NOT WIN32 AND NOT APPLE)
    set_property(TARGET tst_import3drender PROPERTY OUTPUT_NAME tst_import3drender_app)
endif()

target_include_directories(tst_import3drender PRIVATE
    ../../render/qmlscenereader
)

target_link_libraries(tst_import3drender PRIVATE
    Qt${QT_VERSION_MAJOR}::3DCore
    Qt${QT_VERSION_MAJOR}::3DCorePrivate
    Qt${QT_VERSION_MAJOR}::3DQuick
    Qt${QT_VERSION_MAJOR}::3DRender
    Qt${QT_VERSION_MAJOR}::3DRenderPrivate
    Qt${QT_VERSION_MAJOR}::Core
    Qt${QT_VERSION_MAJOR}::CorePrivate
    Qt${QT_VERSION_MAJOR}::Gui
    Qt${QT_VERSION_MAJOR}::Qml
    Qt${QT_VERSION_MAJOR}::Test
)

install(TARGETS tst_import3drender
    BUNDLE DESTINATION .
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

# Consider using qt_generate_deploy_app_script() for app deployment if
# the project can use Qt 6.3. In that case rerun qmake2cmake with
# --min-qt-version=6.3.
